<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>父子组件的通信</title>
		<script src="../../vue/vue.js" type="text/javascript" charset="utf-8"></script>
	</head>
	<body>
		<div id="app">
			<c8 v-bind:cmoves="moves"></c8>
			<!-- 父传子    v-bind:子=父 -->
		</div>
		<template id="tp"><!-- /组件模板 -->
			<div id="">
				{{cmoves}}
				<h2>nh Hhh</h2>
			</div>
		</template>
		<script type="text/javascript">
			Vue.component('c8',{
				template:'#tp',
				data(){
					return{
						
					}
				},
				props:['cmoves']//子
			});
			/* 
			 父组件向子组件传数据  用props
			 */
			var app  = new Vue({
				el:'#app',
				data:{//父
					moves:['超越','一代宗师','风云人物']
				}
			});
		</script>
	</body>
</html>
